<!--  BookBuyActivity.jsp -->
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<html lang="en">
<head>
    <meta charset="UTF-8">
    <script type="text/javascript">
        function we(){
            var t = document.getElementById("btn");
            t.onclick=function(){
                var curCount =document.getElementById("btn").getAttribute("count");
                if(parseInt(curCount)>1){
                    alert("已点击一次")
                }else{
                    document.getElementById("btn").setAttribute("count",parseInt(curCount)+1)
                }
            }
        }
    </script>
    <script  type="text/javascript">
        function $(id){return document.getElementById(id);}
        function createInt()
        {
            var m=parseFloat($("minN").value);//解析为实数
            var n=parseFloat($("maxN").value);//解析为实数
            var array_int=new Array();

                    //产生 m-n 之间的随机数，
                    $("array_num").value=Math.ceil((Math.random()*(n-m)+m));


        /*    $("array_num").value=array_int.join(",");*/
        }
    </script>
</head>
<body>
<div align="center">
<h3>价格随机产生一位，抽中联系客服<br>价格在（25-35元）</h3>
</div>

<br/>

<div  style="width:100%;text-align:center">
<form name="Form1" >
     <input  hidden type="text" name="minN" id="minN" size="20" value=25>
     <input hidden type="text" name="maxN" id="maxN" size="20" value=35><br><br>
    抽中的价格为：<input type="text" name="" id="array_num" size="40" readonly><br><br>
<%--    <input type="button" value="产生10个随机整数" onclick="createInt();">--%>
    <input  type="button"  onclick="createInt();we();" value="产生1个随机数" id="btn" count="1" ></input>
    <input type="button" value="提交价格购买" onclick="javascrtpt:window.location.href='SendPretent'">
</form>
</div>

</body>
</html>